package com.example.design.patterns.geekbang.行为型.职责链模式.敏感词处理;

import com.example.design.patterns.geekbang.行为型.职责链模式.敏感词处理.entity.Content;

public class Test {
    public static void main(String[] args) {
        SensitiveWordFilterChain filterChain = new SensitiveWordFilterChain();
        filterChain.addFilter(new AdsWordFilter());
        filterChain.addFilter(new SexyWordFilter());
        filterChain.addFilter(new PoliticalWordFilter());

        boolean legal = filterChain.filter(new Content());
        if (!legal) {
            // 不发表
            System.out.println("不发表");
        } else {
            // 发表
            System.out.println("发表");
        }
    }
}
